package com.shiver.base.controller;

import com.shiver.base.entity.User;
import com.shiver.base.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/index")
public class IndexController {

    @RequestMapping(value = "/1")
    public ModelAndView index(){
        ModelAndView mv = new ModelAndView();
        mv.addObject("msg","hello myfirst mvc");
        //通过视图名跳转
        mv.setViewName("index");
        return mv;
    }
}
